// 引入 react 依赖
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Text, View, Image, TouchableOpacity, ImageBackground, ScrollView } from 'react-native';

// 引入第三方依赖
import _ from 'lodash';
import pureRender from 'pure-render-decorator';
import { CacheImage } from 'react-native-rn-cacheimage';

// antd 按需加载
import { } from '@ant-design/react-native';

// 引入 处理数据 所需文件
import { } from './module.js'

// 引入样式
import Styles from './style.js';

// 引入公用组件
import { } from '../../components/index.js'

import { size } from '../../util/utils.js'


class VipCard extends Component {
	static propTypes = {

	}

	constructor(props) {
		super(props)
		this.state = {}
	}

	renderFooter() {
		const { data, type, renderFooter } = this.props
		// switch (type) {
		// 	case 'handleCard':
		// 		return (
		// 			<TouchableOpacity
		// 				style={{
		// 					paddingHorizontal: size(24),
		// 					paddingVertical: size(12),
		// 					backgroundColor: '#ffd100',
		// 					borderRadius: size(50),
		// 				}}
		// 			>
		// 				<Text style={{ fontSize: size(28), color: '#3a3a3a', lineHeight: size(32), }}>立即开卡</Text>
		// 			</TouchableOpacity>
		// 		)
		// 	case 'view':
		// 		return (
		// 			<Text style={{ fontSize: size(28), color: '#ffe300', lineHeight: size(32), }}>￥{data.tk_Amount}</Text>
		// 		)
		// }
		return <Text style={{ fontSize: size(28), color: '#ffe300', lineHeight: size(32), }}>￥{data.tk_Amount}</Text>
	}

	render() {
		const { data, type, width, isFooter, height, style } = this.props
		console.log(isFooter, 222222)
		let footerHeight = isFooter !== false ? size(90) : 0
		return (
			<View style={{
				width: width || size(630),
				height: height + footerHeight || size(315),
				flexDirection: 'column',
				borderRadius: size(20),
				overflow: 'hidden',
				backgroundColor: '#3a3a3a',
				...style
			}}>
				<CacheImage
					resizeMode='cover'
					style={{
						width: width || size(630),
						height: height || size(225),
					}}
					source={{ uri: data.tk_Photo }} />
				{isFooter !== false ? (
					<View style={{
						height: size(90),
						justifyContent: 'space-between',
						flexDirection: 'row',
						alignItems: 'center',
						paddingHorizontal: 15,
						backgroundColor: '#3a3a3a'

					}}>
						<Text style={{
							fontSize: size(32),
							color: '#ffe300',
							lineHeight: size(36),
						}}>{data.tk_Name}</Text>
						{this.renderFooter()}
					</View>
				) : null}

			</View>
		)
	}
}

export default pureRender(VipCard)
